package com.zking.service.hcy;

import com.zking.entity.Brand;
import com.zking.entity.Item;
import com.zking.mapper.ItemMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class ItemService {

    @Autowired
    private ItemMapper itemMapper;

    public List<Item> queryItems(){
        return itemMapper.queryItems();
    }

    public boolean delGoods(String id) {
        return itemMapper.delGoods(id) > 0;
    }

    public Item queryItem(int id) {
        return  itemMapper.queryItem(id);
    }

    public boolean addItem(String title,String price,int num,String brand,String seller,String category,String categoryId) {
        return itemMapper.addItem(title,price,num,brand,seller,category,categoryId) > 0;
    }


    public boolean updateItem(int id, String title2, String price2, String num2, String brand2, String category2, String categoryId2) {
        return itemMapper.updateItem(id,title2,price2,num2,brand2,category2,categoryId2) > 0;

    }
//
}
